const ds = require('./onions')
ds.registry('test', async (next) => {
  let x = await next()
  console.log('x', x)
  console.log(1)
})
ds.registry('test', async (next) => {
  console.log(2)
  next()
  return Promise.resolve(666)
})
ds.registry('test', async (next) => {
  console.log(3)
})
ds.registry('th', async () => {
  console.log('th')
})
ds.trigger('test')
ds.trigger('th')